Micron Document
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| SparkN0de-git | SparkN0de |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Displaying Raw • Download


RNS/Utilities/rnsh/loop.py ec8d43a548017de41cdf73e7e3eb9844a5d349cd (ec8d43a5) Text, 2.42 KB

T8b949e# Based on the original rnsh program by Aaron Heise (@acehoss)
T8b949e# https://github.com/acehoss/rnsh - MIT License - Copyright (c) 2023 Aaron Heise
T8b949e# This version of rnsh is included in RNS under the Reticulum License
T8b949e#
T8b949e# Reticulum License
T8b949e#
T8b949e# Copyright (c) 2016-2026 Mark Qvist
T8b949e#
T8b949e# Permission is hereby granted, free of charge, to any person obtaining a copy
T8b949e# of this software and associated documentation files (the "Software"), to deal
T8b949e# in the Software without restriction, including without limitation the rights
T8b949e# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
T8b949e# copies of the Software, and to permit persons to whom the Software is
T8b949e# furnished to do so, subject to the following conditions:
T8b949e#
T8b949e# - The Software shall not be used in any kind of system which includes amongst
T8b949e# its functions the ability to purposefully do harm to human beings.
T8b949e#
T8b949e# - The Software shall not be used, directly or indirectly, in the creation of
T8b949e# an artificial intelligence, machine learning or language model training
T8b949e# dataset, including but not limited to any use that contributes to the
T8b949e# training or development of such a model or algorithm.
T8b949e#
T8b949e# - The above copyright notice and this permission notice shall be included in
T8b949e# all copies or substantial portions of the Software.
T8b949e#
T8b949e# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
T8b949e# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
T8b949e# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
T8b949e# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
T8b949e# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
T8b949e# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
T8b949e# SOFTWARE.

Tff7b72import T7ee787asyncio
Tff7b72import T7ee787functools
Tff7b72from T7ee787typing Tff7b72import Te6edf3Callable

Tff7b72def Td2a8ffsig_handler_sys_to_loopTb4b4b4(Te6edf3handlerTb4b4b4: Te6edf3CallableTb4b4b4[Tb4b4b4[Tffa657intTb4b4b4, Tffa657anyTb4b4b4]Tb4b4b4, Tff7b72NoneTb4b4b4]Tb4b4b4) Tff7b72-Tff7b72> Te6edf3CallableTb4b4b4[Tb4b4b4[Tffa657intTb4b4b4, Te6edf3asyncioTff7b72.Td2a8ffAbstractEventLoopTb4b4b4]Tb4b4b4, Tff7b72NoneTb4b4b4]Tb4b4b4:
Tff7b72def Td2a8ffwrappedTb4b4b4(Te6edf3cbTb4b4b4: Te6edf3CallableTb4b4b4[Tb4b4b4[Tffa657intTb4b4b4, Tffa657anyTb4b4b4]Tb4b4b4, Tff7b72NoneTb4b4b4]Tb4b4b4, Te6edf3signalTb4b4b4: Tffa657intTb4b4b4, Te6edf3loopTb4b4b4: Te6edf3asyncioTff7b72.Td2a8ffAbstractEventLoopTb4b4b4)Tb4b4b4: Te6edf3cbTb4b4b4(Te6edf3signalTb4b4b4, Tff7b72NoneTb4b4b4)
Tff7b72return Te6edf3functoolsTff7b72.Td2a8ffpartialTb4b4b4(Te6edf3wrappedTb4b4b4, Te6edf3handlerTb4b4b4)

Tff7b72def Td2a8ffloop_set_signalTb4b4b4(Te6edf3sigTb4b4b4, Te6edf3handlerTb4b4b4: Te6edf3CallableTb4b4b4[Tb4b4b4[Tffa657intTb4b4b4, Te6edf3asyncioTff7b72.Td2a8ffAbstractEventLoopTb4b4b4]Tb4b4b4, Tff7b72NoneTb4b4b4]Tb4b4b4, Te6edf3loopTb4b4b4: Te6edf3asyncioTff7b72.Td2a8ffAbstractEventLoop Tff7b72= Tff7b72NoneTb4b4b4)Tb4b4b4:
Tff7b72if Te6edf3loop Tff7b72is Tff7b72NoneTb4b4b4: Te6edf3loop Tff7b72= Te6edf3asyncioTff7b72.Td2a8ffget_running_loopTb4b4b4(Tb4b4b4)
Te6edf3loopTff7b72.Td2a8ffremove_signal_handlerTb4b4b4(Te6edf3sigTb4b4b4)
Te6edf3loopTff7b72.Td2a8ffadd_signal_handlerTb4b4b4(Te6edf3sigTb4b4b4, Te6edf3functoolsTff7b72.Td2a8ffpartialTb4b4b4(Te6edf3handlerTb4b4b4, Te6edf3sigTb4b4b4, Te6edf3loopTb4b4b4)Tb4b4b4)


──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────